<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('未受理电话工单')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            工单编号：<input type="text" name="myTwfNO"/>
                        </li>
                        <li>
                            派发单位：<input type="text" name="sdeptName"/>
                        <li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm " id="toolbar" role="group">
            <a class="btn btn-info" onclick="$.table.exportExcel()">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/common/js/common.js}"></script>
<script th:inline="javascript">
    var prefix = ctx + "system/mTelWF";
    var mInterior = ctx + "system/mInterior";
    $(function () {
        var options = {
            url: prefix + "/cmnFile/notHandleTelJson",
            exportUrl: prefix + '/cmnFile/notHandleTelExport',
            sortName: "pkId",
            sortOrder: "desc",
            uniqueId: "pkId",
            modalName: "未受理电话工单",
            fixedColumns: true,
            fixedNumber: 3,
            fixedRightNumber: 1,
            columns: [{
                checkbox: true
            },
                {field: 'PkId', title: 'PkId',visible:false},
                {field: 'WfId', title: 'WfId',visible:false},
                {field: 'BackState', title: 'BackState',visible:false},
                {field:'myTwfNO',title:'工单编号',align:'center',sortable:true},
                {field:'myTwfTopic',title:'工单主题',align:'center', formatter:function (value, row, index,field) {
                        return "<span style='cursor: pointer;' title='"+value+"'>"+value+"</span>"
                    },
                    cellStyle: cellEllipsis
                },
                {field: 'FmContent', title: '工单内容', align: 'center',formatter:function (value, row, index,field) {
                        return "<span style='cursor: pointer;' title='"+value+"'>"+value+"</span>"
                    },
                    cellStyle: cellEllipsis},
                {field: 'SeqName', title: '交办次序', align: 'center'},
                {field: 'SortName', title: '性质', align: 'center'},
                {field: 'DealName', title: '办理方式', align: 'center'},
                {field: 'bkLimit', title: '办理期限', align: 'center', sortable: true},
                {field: 'sdDate', title: '派发日期', align: 'center', sortable: true, width: '100px'},
                {field: 'SDeptName', title: '派发单位', align: 'center'},
                {field: 'SBDeptName',title:'承办部门',align:'left',sortable:true},
                {field: 'SendState',title:'当前流程',align:'left',sortable:true,formatter: function (value, row, index) {
                        return currentSendState(value, row, index);
                    }
                }]
        };
        $.table.init(options);
    });

    function currentSendState(value, row, index) {
        var rtn = value;
        var myVal = parseInt(value);
        var backState = row.BackState;
        switch (myVal) {
            case 0:
                rtn = '<div>none</div>';
                break;
            case 10:
                rtn = '<div class="spRed">未签收</div>';
                break;
            case 11:
                rtn = '<div class="spOrange">再次派单</div>';
                break;
            case 40:
                if(backState === 21){
                    rtn = '<div class="spRed">退回（上级同意）</div>';
                }else{
                    rtn = '<div class="spRed">退回（待审）</div>';
                }
                break;
            case 51:
                rtn = '<div class="spRed">拒退</div>';
                break;
            default:
                break;
        }
        return rtn;
    }
</script>
</body>
</html>